<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
	<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
	<!-- <script src="/nicEdit/nicEdit.js" type="text/javascript"></script>  -->
<script type="text/javascript">
/* bkLib.onDomLoaded(function() { 
    new nicEditor({ fullPanel: true }).panelInstance('guanggao');
}); */
	$(function() {
		$("#add_Content_form").validate({
			success : function(label) {
				label.text("").addClass("validate_success");
			},
			rules : {

				title : {
					required : true,
					minlength : 2,
					maxlength : 16
				}
			},
			messages : {
				title : {
					required : "请输入画的标题",
					minlength : "请填写2个以上字",
					maxlength : "请填写20个以下的字"
				}
			},
			submitHandler : function() {
				$.post("/misc/index/updateAuxContent.htm", {
					identifier:$("#identifier").val(),
					title : $("#title").val(),
					link:$("#link").val(),
					channel : $("#channel").val(),
					picture : $("#picture").attr("src"),
					pictureT : $("#pictureT").attr("src"),
					description : $("#description").val(),
					guanggao : $("#guanggao").val()
				}, function(data) {
					if (data == "success") {
						alert("更新成功！");
					}
					if (data == "error") {
						$.ligerDialog.warn("系统有点抽经，请稍候重试！");
					}
				});
			}
		});

		//初始化富文本
		editor = $(".desc")
				.xheditor(
						{
							tools : 'Removeformat,Fontface,FontSize,Bold,Italic,Underline,Strikethrough,FontColor,BackColor,Align,Link',
							skin : 'default',
							showBlocktag : false,//段落标签
							internalScript : false,
							internalStyle : false,
							width : 500,
							height : 150,
							fullscreen : false,
							forcePtag : true,
							cleanPaste : 1,
							upMultiple : 1,
							html5Upload : false
						});
		
		editorstory = $("#guanggao").xheditor(
				{
					tools : 'Removeformat,Fontface,FontSize,Bold,Italic,Underline,Strikethrough,FontColor,BackColor,Align,Link,Img',
					skin : 'default',
					showBlocktag : false,//段落标签
					internalScript : false,
					internalStyle : false,
					width : 500,
					height : 450,
					fullscreen : false,
					forcePtag : true,
					cleanPaste : 1,
					upMultiple : 1,
					html5Upload : false,
					upImgUrl:"/misc/xheditor/uploadImg.htm",
					upImgExt:"jpg,jpeg,gif,png"
				});

	});
</script>
					
					<c:choose>
						<c:when test="${channel eq 'af054a6cd30846d2bab02a019cbe79b5' || channel eq 'ef179d6109eb4fc3956c17771f794572'
										|| channel eq 'caf762a9406745a882de7e300162ef6b' || channel eq '87aa1862c16f4e43ab3f673912a4bced'  || channel eq '5cf7dd43b24a423baa183b3e2c90586f' 
										|| channel eq 'bda93856df5849b7bbef22c83a6c65ae'  || channel eq '3473b6a978bb4f6184f6dc251a9df921'  || channel eq '1a9fc2d7168e4ff8b6d13291b93f53bc'
										|| channel eq '4517ca0063104b19ace8768c7cf88138' || channel eq '9c90ac73589c4f6a85dd5bb50ce39efc' || channel eq '355c016b28f144bdbdab8f553cd23b38'
										|| channel eq 'f37b44893d3a4873bbdf340f5066ce8a' || channel eq '78f10bc4c14748d28b9dce8b7a247243'
										|| channel eq '8d9c2de5cd4f45eab976b5f4a4b84c24'|| channel eq 'ef179d6109eb4fc3956c17771f794572'|| channel eq 'ourMission'
											||  channel eq 'activityRemark'  || channel eq 'contactUs'|| channel eq 'blog'|| channel eq 'mediaCenter'|| channel eq 'recruitment'
						}"> 
						</c:when>	
						<c:otherwise>
					<table width="80%" class="def_t">
						<tr>
							<td>上传图片：</td>
							<td align="left" class="l-table-edit-td">
							<form id="upload_img_form" enctype="multipart/form-data" method="post" action="/misc/artPic/uploadImg.htm">
								<input type="file" onchange="uploadCmsImg(this);return false;""  style="width: 200px;" name="imagecontent" id="imagecontent" />
								<img src="${content.picture}" alt="" class="user_img" id="picture" width="100px" height="100px"/>
							</form>
							　
							</td>
						</tr>
					</table>
					</c:otherwise>
				</c:choose>
				
				
			<c:if test="${type eq 'made' &&  channel eq '43a36924cb50414482023bd0697385ac'}">
					<table width="80%" class="def_t">
						<tr>
							<td>（定制）小图上传：</td>
								<td align="left" class="l-table-edit-td">
								<form id="upload_img_formXiao" enctype="multipart/form-data" method="post" action="/misc/artPic/uploadImg.htm">
									<input type="file" onchange="uploadCmsImg(this);return false;""  style="width: 200px;"  name="imagecontent" id="imagecontent"/>
									<img src="${content.pictureT}" alt="" class="user_img" id="pictureT" width="100px" height="100px"/>
								</form>
								　
								</td>
						</tr>
					</table>
			</c:if>
				<form method="post" id="add_Content_form" action="">
					<table width="80%" class="def_t">
						<tr>
							<td>标题：</td>
							<td><input type="text" id="title" name="title" value="${content.title }"  /> 
							<input type="hidden" id="channel" name="channel" value="${content.channel }"/>
							<input type="hidden" id="identifier" name="identifier" value="${content.identifier}"/>
							</td>
						</tr>
						
		   <c:choose>
					<c:when test="${type eq 'auction' || channel eq '1a9fc2d7168e4ff8b6d13291b93f53bc' || 
								channel eq '28b3ccdf6b9f47d189a0a04baf2a6378' ||channel eq '43a36924cb50414482023bd0697385ac'
								|| channel eq 'cd92ec9b1c1d49fa9a2f1d4280e9afe8' || channel eq '4517ca0063104b19ace8768c7cf88138'
								|| channel eq '9c90ac73589c4f6a85dd5bb50ce39efc'|| channel eq 'ourMission'
							   || channel eq 'contactUs'|| channel eq 'blog'|| channel eq 'mediaCenter'|| channel eq 'recruitment'
								||  channel eq 'activityRemark'  
								}"> </c:when>		
						<c:otherwise>
						<tr>
							<td>超链接：</td>
							<td><input type="text" id="link" name="link" value="${ content.link}"/> </td>
						</tr>
						</c:otherwise>
			</c:choose>
			
	    <c:choose>
					<c:when test="${channel eq 'af054a6cd30846d2bab02a019cbe79b5'}"> 
							<tr>
							<td>描述：</td>
								<td><textarea id="description"   name="description"
								cols="200" style="width: 450px"></textarea>
							</td>
							</tr>
					</c:when>	
					<c:otherwise>
								<c:choose>
									<c:when test="${channel eq '8d9c2de5cd4f45eab976b5f4a4b84c24' || channel eq '78f10bc4c14748d28b9dce8b7a247243' 
											|| channel eq 'f37b44893d3a4873bbdf340f5066ce8a'  || channel eq 'caf762a9406745a882de7e300162ef6b' 
											|| channel eq '87aa1862c16f4e43ab3f673912a4bced'  || channel eq '5cf7dd43b24a423baa183b3e2c90586f' 
											|| channel eq 'bda93856df5849b7bbef22c83a6c65ae'  || channel eq '3473b6a978bb4f6184f6dc251a9df921' 
											|| channel eq '57e5aa15c3eb409889000f2b8f18b924'|| channel eq '501b6ef9bbc5425eb354a8861fef35a8'
											||  channel eq '43a36924cb50414482023bd0697385ac'	||  channel eq 'cd92ec9b1c1d49fa9a2f1d4280e9afe8'
											|| channel eq '355c016b28f144bdbdab8f553cd23b38'  || channel eq 'ef179d6109eb4fc3956c17771f794572'
											 || channel eq '589d6722ceb24473a4d98c5b81cd475d'|| channel eq 'ourMission'
											  || channel eq 'contactUs'|| channel eq 'blog'|| channel eq 'mediaCenter'|| channel eq 'recruitment'
											 
											}" >
									</c:when>
									<c:otherwise>
						<tr>
							<td>描述：</td>
							<td><textarea id="description" class='desc' name="description" cols="200" style="width: 450px">${content.description }</textarea>
							</td>
						</tr>
										</c:otherwise>	
								</c:choose>
					</c:otherwise>
		</c:choose>
		<c:choose>
			<c:when test="${channel  eq 'af054a6cd30846d2bab02a019cbe79b5' ||  channel eq 'af054a6cd30846d2bab02a019cbe79b5'
			   ||  channel eq '57e5aa15c3eb409889000f2b8f18b924' ||  channel eq '501b6ef9bbc5425eb354a8861fef35a8'
			   ||  channel eq '1a9fc2d7168e4ff8b6d13291b93f53bc' ||  channel eq '28b3ccdf6b9f47d189a0a04baf2a6378'
			   ||  channel eq '43a36924cb50414482023bd0697385ac' ||  channel eq '4517ca0063104b19ace8768c7cf88138'
			   ||  channel eq 'cd92ec9b1c1d49fa9a2f1d4280e9afe8' ||  channel eq '355c016b28f144bdbdab8f553cd23b38'
			   ||  channel eq '9c90ac73589c4f6a85dd5bb50ce39efc' || channel eq '589d6722ceb24473a4d98c5b81cd475d'
			   ||  channel eq 'activityRemark'  
			  }"> 
			
			</c:when>	
			<c:otherwise>
						
						<tr>
							<td colspan="2">*以下为广告填写*其他则不需填写</td>
						</tr>
						<tr>
							<td>广告内容：</td>
							<td>
								<textarea id="guanggao"   name="guanggao" cols="200" style="width: 450px;height: 200px;">${ content.guanggao}</textarea>
							</td>
						</tr>
					</c:otherwise>
			</c:choose>	
						
						
						<tr>
							<td colspan="2" style="text-align: center;"> <button type="submit">更新</button></td>
						</tr>
					</table>
				</form>
